﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Aj.Core;
using Aj.Core.Control;

public partial class Manager_JobList : AuthPageBase
{
    protected string mname = "";
    protected DataSet ds = null;
    PageStructure ps = new PageStructure() { PageSize = 10, CurrPage = 1 };

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        try
        {
            mname = QueryParam("mname");
            ps.CurrPage = QueryParamInt32("page", 1);

            // 删除
            if (!string.IsNullOrEmpty(QueryParam("d")) && QueryParamInt32("d") > 0)
            {
                CustomQuery.Job_Delete(QueryParamInt32("d"));
            }

            string where = "";
            if (mname.IsNotNullAndEmpty())
            {
                if (Utility.ProcessSqlStr(mname))
                {
                    where += " and J_Name like '%" + mname + "%' ";
                }
            }

            ds = CustomQuery.Job_GetJobsByPage(where, ref ps);
            pager1.PageStruct = ps;
        }
        catch (Exception ex)
        {
            Utility.WriteErrorLog(ex);
        }
    }
}